import 'package:p_location/map/res/user_path_point.dart';

class UserPathGroupDTO {
    String buildId;
    int floorId;
    List<UserPathPoint> points;
    int t0;
    int t1;

    UserPathGroupDTO({this.buildId, this.floorId, this.points, this.t0, this.t1});

    factory UserPathGroupDTO.fromJson(Map<String, dynamic> json) {
        return UserPathGroupDTO(
            buildId: json['buildId'], 
            floorId: json['floorId'], 
            points: json['points'] != null ? (json['points'] as List).map((i) => UserPathPoint.fromJson(i)).toList() : null,
            t0: json['t0'], 
            t1: json['t1'], 
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data['buildId'] = this.buildId;
        data['floorId'] = this.floorId;
        data['t0'] = this.t0;
        data['t1'] = this.t1;
        if (this.points != null) {
            data['points'] = this.points.map((v) => v.toJson()).toList();
        }
        return data;
    }
}